package com.sc.admin.test;

import lombok.Data;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.EqualsAndHashCode;
import com.sc.common.entity.AbstractBaseEntity;
import java.io.Serial;
import java.time.LocalDateTime;
import java.time.LocalDate;
import com.sc.common.entity.IEnum;
import com.baomidou.mybatisplus.annotation.EnumValue;
import lombok.Getter;
import lombok.AllArgsConstructor;
import java.util.Map;
import java.util.List;

/**
 * 管理员
 */
@Data
@TableName("sd_administrators")
@EqualsAndHashCode(callSuper = true)
public class AdministratorsEntity extends AbstractBaseEntity {

    @Serial
    private final static long serialVersionUID = 1L;

    /**
     * 用户名
     */
    private String name;

    /**
     * 账号
     */
    private String account;

    /**
     * 密码
     */
    private String password;

    /**
     * 密码错误次数
     */
    private Integer errorNumber;

    /**
     * 最近登录
     */
    private LocalDateTime latelyTime;

    /**
     * 错误日期
     */
    private LocalDate errorDate;

    /**
     * 状态
     */
    private Status status;

    /**
     * 角色
     */
    private String roleIds;

    /**
     * 创建人
     */
    private Long createId;

    
    /**
     * 管理员 状态
     */
    @Getter
    @AllArgsConstructor
    public enum Status implements IEnum {
        NORMAL(1, "正常"),
        FREEZE(2, "冻结");
    
        @EnumValue
        private final Integer value;
    
        private final String desc;
    
    
        public static List<Map<String, Object>> getEnumList(){
            return IEnum.getEnumList(Status.values());
        }
    }

}